package 哈希表;

import java.util.Arrays;
import java.util.HashMap;

public class 缺失的第一个正整数 {
    public int minNumberDisappeared (int[] nums) {
        int[] res = new int[nums.length + 1];
        for (int i = 0; i < nums.length; ++i) {
            if (nums[i]<nums.length&&nums[i]>0){
                res[nums[i]] = 1;
            }
        }
        for (int i = 1; i < nums.length; ++i) {
            if (res[i] == 0) return i;
        }
        return nums.length;
    }
}
